<?php /*a:3:{s:87:"C:\project_xxxxxxxxxxxxxx\php_study\hemaphp\app\store\view\food\market\setting\vip.html";i:1756568969;s:75:"C:\project_xxxxxxxxxxxxxx\php_study\hemaphp\app\store\view\layout\food.html";i:1756568970;s:48:"../addons/upload/view/template/file_library.html";i:1653298470;}*/ ?>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8"/>
    <meta http-equiv="X-UA-Compatible" content="IE=edge"/>
    <title><?php echo htmlentities($app_name); ?>管理后台</title>
	<meta name="author" content="<?php echo htmlentities($web['name']); ?>">
	<meta name="keywords" content="<?php echo htmlentities($web['keywords']); ?>">
	<meta name="description" content="<?php echo htmlentities($web['description']); ?>">
    <meta name="viewport" content="width=device-width, initial-scale=1"/>
    <meta name="referrer" content="no-referrer-when-downgrade">
    <meta http-equiv="Cache-Control" content="no-siteapp"/>
    <link rel="icon" href="/favicon.png" type="image/x-icon">
    <link rel="stylesheet" href="/assets/plugins/amazeui/amazeui.css?v=<?php echo htmlentities($version); ?>"/>
    <link rel="stylesheet" href="/assets/css/hema.app.css?v=<?php echo htmlentities($version); ?>"/>
    <link rel="stylesheet" href="/addons/upload/css/file.library.css?v=<?php echo htmlentities($version); ?>"/>
    <script src="/assets/plugins/jquery/jquery.min.js?v=<?php echo htmlentities($version); ?>"></script>
    <link rel="stylesheet" href="/assets/plugins/iconfont/iconfont.css?v=<?php echo htmlentities($version); ?>">
    <script src="/assets/plugins/iconfont/iconfont.js?v=<?php echo htmlentities($version); ?>"></script>
    <script>
        BASE_URL = "<?php echo isset($base_url) ? $base_url : ''; ?>";
        STORE_URL = "<?php echo isset($store_url) ? $store_url : ''; ?>";
        APPLET_ID = "<?php echo isset($applet_id) ? $applet_id : 0; ?>";
    </script>
</head>

<body data-type="">
<div class="am-g tpl-g">
    <!-- 头部 -->
    <header class="tpl-header">
        <!-- 右侧内容 -->
        <div class="tpl-header-fluid">
            <!-- 侧边切换 -->
            <div class="am-fl tpl-header-button switch-button">
                <i class="iconfont iconzhedie"></i>
            </div>
            <!-- 刷新页面 -->
            <div class="am-fl tpl-header-button refresh-button">
                <i class="iconfont iconshuaxin"></i>
            </div>
            <!-- 超链接-->
            <div class="am-fl tpl-header-navbar">
                <ul>
                    <!-- 网站首页 -->
                    <li class="am-text-sm">
                        <a href="/">
                            <i class="iconfont iconshouye"></i> 网站首页
                        </a>
                    </li>
                </ul>
            </div>
            <!-- 其它功能-->
			<div class="am-fr tpl-header-navbar">
				<ul>
				    <li class="am-text-sm"> 
					    <div class="am-dropdown" data-am-dropdown="{boundary: '.am-topbar'}">
							<div class="am-topbar-btn am-dropdown-toggle" data-am-dropdown-toggle>
								<img src="<?php echo htmlentities($user['user']['avatar']); ?>" /> 
								<?php echo htmlentities($user['user']['user_name']); ?>
								<span class="am-icon-caret-down"></span> 
							</div>
							<ul class="am-dropdown-content">
							    <li><a href="/user">用户中心</a></li>
								<li><a href="/store/<?php echo htmlentities($app_type); ?>.setting/renew">修改密码</a></li>
								<li><a href="/store/passport/<?php echo htmlentities($logout); ?>?app_type=<?php echo htmlentities($app_type); ?>">安全退出</a></li>
							</ul>
						</div>
					</li>
				</ul>
			</div>
        </div>
    </header>
    <!-- 侧边导航栏 -->
    <div class="left-sidebar dis-flex">
        <!-- 一级菜单 -->
        <ul class="sidebar-nav">
            <li class="sidebar-nav-heading"><?php echo htmlentities($app_name); ?> <small>V<?php echo htmlentities((isset($version) && ($version !== '')?$version:'1.0.0')); ?></small></li>
            <?php foreach($menus as $key => $item): ?>
                <li class="sidebar-nav-link">
                    <a href="<?php echo isset($item['index'])?url($item['index']):'javascript:void(0);'; ?>"
                       class="<?php echo !empty($item['active']) ? 'active' : ''; ?>">
                        <?php if(isset($item['is_svg']) && $item['is_svg'] === true): ?>
                            <svg class="icon sidebar-nav-link-logo" aria-hidden="true">
                                <use xlink:href="#<?php echo htmlentities($item['icon']); ?>"></use>
                            </svg>
                        <?php else: ?>
                            <i class="iconfont sidebar-nav-link-logo <?= $item['icon'] ?>"
                               style="color:<?php echo isset($item['color'])?$item['color']:''; ?>;"></i>
                        <?php endif; ?>
                        <?php echo htmlentities($item['name']); ?>
                    </a>
                </li>
            <?php endforeach; ?>
        </ul>
        <!-- 子级菜单-->
        <?php $second = isset($menus[$group]['submenu']) ? $menus[$group]['submenu'] : []; if(!empty($second)): ?>
            <ul class="left-sidebar-second">
                <li class="sidebar-second-title"><?php echo htmlentities($menus[$group]['name']); ?></li>
                <li class="sidebar-second-item">
                    <?php foreach($second as $item): if(!isset($item['submenu'])): ?>
                            <!-- 二级菜单-->
                            <a href="<?= url($item['index']) ?>" class="<?= $item['active'] ? 'active' : '' ?>">
                                <?= $item['name']; ?>
                            </a>
                        <?php else: ?>
                            <!-- 三级菜单-->
                            <div class="sidebar-third-item">
                                <a href="javascript:void(0);"
                                   class="sidebar-nav-sub-title <?php echo !empty($item['active']) ? 'active'  :  ''; ?>">
                                    <i class="iconfont icongengduo"></i>
                                    <?php echo htmlentities($item['name']); ?>
                                </a>
                                <ul class="sidebar-third-nav-sub">
                                    <?php foreach($item['submenu'] as $third): ?>
                                        <li>
                                            <a class="<?php echo !empty($third['active']) ? 'active'  :  ''; ?>"
                                               href="<?php echo url($third['index']); ?>">
                                                <?php echo htmlentities($third['name']); ?>
                                            </a>
                                        </li>
                                    <?php endforeach; ?>
                                </ul>
                            </div>
                        <?php endif; ?>
                    <?php endforeach; ?>
                </li>
            </ul>
        <?php endif; ?>
    </div>
    <!-- 内容区域 start -->
    <div class="tpl-content-wrapper <?php echo empty($second) ? 'no-sidebar-second' : ''; ?>">
        <div class="row-content am-cf">    <div class="row">        <div class="am-u-sm-12 am-u-md-12 am-u-lg-12">            <div id="my-form" class="widget am-cf">                    <div class="widget-body am-form tpl-form-line-form">                        <fieldset>                            <div class="widget-head am-cf">                                <div class="widget-title am-fl">会员卡设置</div>                            </div>                            <div class="am-form-group">                                <label class="am-u-sm-3 am-u-lg-2 am-form-label form-require">付费开通</label>                                <div class="am-u-sm-9 am-u-end">                                    <input type="number" min="0" class="tpl-form-input" v-model="model.buy_price" required>                                    <small>开通会员卡是否要购买，单位元，设置0则不需要支付费用。</small>                                </div>                            </div>                            <div class="am-form-group">                                <label class="am-u-sm-3 am-u-lg-2 am-form-label form-require">会员折扣 </label>                                <div class="am-u-sm-9 am-u-end">                                	<label class="am-radio-inline">                                        <input type="radio" v-model="model.vip_discount" value="1" data-am-ucheck>                                        开启                                    </label>                                    <label class="am-radio-inline">                                        <input type="radio" v-model="model.vip_discount" value="0" data-am-ucheck>                                        关闭                                    </label>                                </div>                            </div>                            <section data-am-widget="accordion" class="am-accordion am-accordion-basic">                            <dl v-for="(item,index) in model.vip" class="am-accordion-item am-active">                            <dt class="am-accordion-title" style="padding-bottom:20px;">                                {{model.vip[index].name}}设置                            </dt>                            <dd class="am-accordion-bd am-collapse am-in">                            <div class="am-form-group">                                <label class="am-u-sm-3 am-u-lg-2 am-form-label form-require">                                    会员卡封面                                </label>                                <div class="am-u-sm-9 am-u-end">                                    <div class="am-form-file">                                        <button type="button" class="upload-file am-btn am-btn-secondary am-radius" @click.stop="selectImages(index)">                                            <i class="am-icon-cloud-upload"></i> 选择图片                                        </button>                                        <div class="uploader-list am-cf">                                            <div class="file-item">                                                <img :src="model.vip[index].card_cover">                                            </div>                                        </div>                                    </div>                                    <div class="help-block am-margin-top-sm">                                        <small>尺寸650x300像素以上，大小2M以下</small>                                    </div>                                </div>                            </div>                            <div class="am-form-group">                                <label class="am-u-sm-3 am-u-lg-2 am-form-label form-require">等级名称</label>                                <div class="am-u-sm-9 am-u-end">                                    <input type="text" class="tpl-form-input" v-model="model.vip[index].name" required>                                </div>                            </div>                            <div class="am-form-group">                                <label class="am-u-sm-3 am-u-lg-2 am-form-label form-require">成长积分</label>                                <div class="am-u-sm-9 am-u-end">                                    <input type="number" min="0" class="tpl-form-input" v-model="model.vip[index].score" :disabled="index==0?true:false" required>                                    <small>设置该等级所需要的成长值，消费1元=1积分</small>                                </div>                            </div>                            <div class="am-form-group">                                <label class="am-u-sm-3 am-u-lg-2 am-form-label form-require">免配送费</label>                                <div class="am-u-sm-9 am-u-end">                                	<label class="am-radio-inline">                                        <input type="radio" v-model="model.vip[index].free_delivery" value="1" data-am-ucheck>                                        开启                                    </label>                                    <label class="am-radio-inline">                                        <input type="radio" v-model="model.vip[index].free_delivery" value="0" data-am-ucheck>                                        关闭                                    </label>                                </div>                            </div>                            <div class="am-form-group">                                <label class="am-u-sm-3 am-u-lg-2 am-form-label form-require">等级折扣</label>                                <div class="am-u-sm-9 am-u-end">                                    <input type="number" min="10" max="100" class="tpl-form-input" v-model="model.vip[index].discount" required>                                    <small>取值10-100,设置100无折扣，设置85为85折</small>                                </div>                            </div>                            <div class="am-form-group">                                <label class="am-u-sm-3 am-u-lg-2 am-form-label">升级赠券</label>                                <div class="am-u-sm-9 am-u-end">                                    <div class="widget-become-goods am-form-file am-margin-top-xs">                                        <button type="button" class="upload-file am-btn am-btn-secondary am-radius" @click.stop="onSelect(index)">                                            <i class="am-icon-cloud-upload"></i> 选择优惠券                                        </button>                                        <div class="coupon-list uploader-list am-cf">                                            <div v-for="(item,index2) in model.vip[index].gift" class="file-item">                                                <i class="iconfont iconshanchu item-delete am-fr"  @click="onDelete(index2,index)"></i>                                                <div><img :src="item.image"></div>                                                <div style="text-align: center;"><small>{{item.name}}</small></div>                                            </div>                                        </div>                                    </div>                                </div>                            </div>                            </dd>                            </dl>                            </section>                            <div class="am-form-group">                                <div class="am-u-sm-9 am-u-sm-push-2 am-margin-top-lg">                                    <button @click.stop="onSubmit" type="button" class="am-btn am-btn-secondary">                                        提交保存                                    </button>                                </div>                            </div>                        </fieldset>                    </div>            </div>        </div>    </div></div><!-- 文件库弹窗 --><!-- 文件库模板 -->
<script id="tpl-file-library" type="text/template">
    <div class="row">
        <div class="file-group">
            <ul class="nav-new">
                <li class="ng-scope {{ is_default ? 'active' : '' }}" data-group-id="0">
                    <a class="group-name am-text-truncate" href="javascript:void(0);" title="全部">全部</a>
                </li>
                <li class="ng-scope" data-group-id="-1">
                    <a class="group-name am-text-truncate" href="javascript:void(0);" title="未分组">未分组</a>
                </li>
                {{ each group_list }}
                <li class="ng-scope"
                    data-group-id="{{ $value.group_id }}" title="{{ $value.group_name }}">
                    <a class="group-edit" href="javascript:void(0);" title="编辑分组">
                        <i class="iconfont iconbianji"></i>
                    </a>
                    <a class="group-name am-text-truncate" href="javascript:void(0);">
                        {{ $value.group_name }}
                    </a>
                    <a class="group-delete" href="javascript:void(0);" title="删除分组">
                        <i class="iconfont iconshanchu"></i>
                    </a>
                </li>
                {{ /each }}
            </ul>
            <a class="group-add" href="javascript:void(0);">新增分组</a>
        </div>
        <div class="file-list">
            <div class="v-box-header am-cf">
                <div class="h-left am-fl am-cf">
                    <div class="am-fl">
                        <div class="group-select am-dropdown">
                            <button type="button" class="am-btn am-btn-sm am-btn-secondary am-dropdown-toggle">
                                移动至 <span class="am-icon-caret-down"></span>
                            </button>
                            <ul class="group-list am-dropdown-content">
                                <li class="am-dropdown-header">请选择分组</li>
                                {{ each group_list }}
                                <li>
                                    <a class="move-file-group" data-group-id="{{ $value.group_id }}"
                                       href="javascript:void(0);">{{ $value.group_name }}</a>
                                </li>
                                {{ /each }}
                            </ul>
                        </div>
                    </div>
                    <div class="am-fl file-library-operation">
                        <a href="javascript:void(0);" class="file-delete tpl-table-black-operation-del"
                           data-group-id="2">
                            <i class="am-icon-trash"></i> 删除
                        </a>
                    </div>
                </div>
                <div class="h-rigth am-fr">
                    <div class="j-upload upload-image">
                        <i class="iconfont icontianjia"></i>
                        上传图片
                    </div>
                </div>
            </div>
            <div id="file-list-body" class="v-box-body">
                {{ include 'tpl-file-list' file_list }}
            </div>
            <div class="v-box-footer am-cf"></div>
        </div>
    </div>

</script>

<!-- 文件列表模板 -->
<script id="tpl-file-list" type="text/template">
    <ul class="file-list-item">
        {{ include 'tpl-file-list-item' data }}
    </ul>
    {{ if last_page > 1 }}
    <div class="file-page-box am-fr">
        <ul class="pagination">
            {{ if current_page > 1 }}
            <li>
                <a class="switch-page" href="javascript:void(0);" title="上一页" data-page="{{ current_page - 1 }}">«</a>
            </li>
            {{ /if }}
            {{ if current_page < last_page }}
            <li>
                <a class="switch-page" href="javascript:void(0);" title="下一页" data-page="{{ current_page + 1 }}">»</a>
            </li>
            {{ /if }}
        </ul>
    </div>
    {{ /if }}
</script>

<!-- 文件列表模板 -->
<script id="tpl-file-list-item" type="text/template">
    {{ each $data }}
    <li class="ng-scope" title="{{ $value.file_name }}" data-file-id="{{ $value.file_id }}"
        data-url="{{ $value.url }}" data-file-path="{{ $value.file_path }}">
        <div class="img-cover"
             style="background-image: url('{{ $value.url }}')">
        </div>
        <p class="file-name am-text-center am-text-truncate">{{ $value.file_name }}</p>
        <div class="select-mask">
            <img src="/assets/img/chose.png">
        </div>
    </li>
    {{ /each }}
</script>

<!-- 分组元素-->
<script id="tpl-group-item" type="text/template">
    <li class="ng-scope" data-group-id="{{ group_id }}" title="{{ group_name }}">
        <a class="group-edit" href="javascript:void(0);" title="编辑分组">
            <i class="iconfont iconbianji"></i>
        </a>
        <a class="group-name am-text-truncate" href="javascript:void(0);">
            {{ group_name }}
        </a>
        <a class="group-delete" href="javascript:void(0);" title="删除分组">
            <i class="iconfont iconshanchu"></i>
        </a>
    </li>
</script>
<script src="/assets/plugins/vue/vue.min.js?v=<?php echo htmlentities($version); ?>"></script><script src="/addons/food/js/select.data.js?v=<?php echo htmlentities($version); ?>"></script><script>    $(function () {        const vue = new Vue({            el: '#my-form',            data: {                model: <?= json_encode($model) ?>            },            methods: {                setGift:function(data,index){                    let model = this.model;                    if(!model.vip[index].gift){                        newGift = [];                    }else{                       newGift = model.vip[index].gift;                    }                    data.forEach(function(item) {                        newGift.push(item)                    });                    Vue.set(this.model.vip[index],'gift',newGift);                },                //删除组件数据项目                onDelete: function(index2, index) {                    let model = this.model;                    model.vip[index].gift.splice(index2, 1);                    this.model = model;                },                //获取优惠券列表                onSelect: function(index) {                    $.selectData({                        title: '选择优惠券',                        uri: 'coupon/lists',                        duplicate: false,                        dataIndex: 'id',                        done: function(data) {                            vue.setGift(data,index);                        }                    });                },                //选择图片                selectImages:function(index){                    // 显示文件库 选择文件                    $.fileLibrary({                        type: 'image'                        , done: function (data, $touch) {                            vue.model.vip[index].card_cover = data[0].url;                        }                    });                },                //提交保存                onSubmit: function() {                    $.post('', {                        data: this.model                    }, function(result) {                        result.code === 1 ? $.show_success(result.msg, result.url) : $.show_error(result.msg)                    })                }            }        });    });</script>
    </div>
    <!-- 内容区域 end -->

</div>
<script src="/assets/plugins/layer/layer.js?v=<?php echo htmlentities($version); ?>"></script>
<script src="/assets/plugins/jquery/jquery.form.min.js?v=<?php echo htmlentities($version); ?>"></script>
<script src="/assets/plugins/amazeui/amazeui.min.js?v=<?php echo htmlentities($version); ?>"></script>
<script src="/assets/js/hema.app.js?v=<?php echo htmlentities($version); ?>"></script>
<script src="/assets/js/webuploader.html5only.js?v=<?php echo htmlentities($version); ?>"></script>
<script src="/assets/js/art-template.js?v=<?php echo htmlentities($version); ?>"></script>
<script src="/addons/upload/js/file.library.js?v=<?php echo htmlentities($version); ?>"></script>
</body>

</html>
